set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

if("usage" IN_LIST FEATURES)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "Set TEST=${CURRENT_INSTALLED_DIR} to use the port\n")
endif()
if("header" IN_LIST FEATURES)
    configure_file("${CURRENT_PORT_DIR}/source.h.in" "${CURRENT_PACKAGES_DIR}/include/test.h")
endif()
if("header-comment" IN_LIST FEATURES)
    configure_file("${CURRENT_PORT_DIR}/source-comment.h.in" "${CURRENT_PACKAGES_DIR}/include/test.h")
endif()
if("python" IN_LIST FEATURES)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py" "test = \"${CURRENT_INSTALLED_DIR}\"\n")
    message(STATUS "Wtite to ${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py")
endif()
if("python-comment" IN_LIST FEATURES)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py" "# test = \"${CURRENT_INSTALLED_DIR}\"\n")
endif()
if("hash" IN_LIST FEATURES)
    configure_file("${CURRENT_PORT_DIR}/hash.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/test")
endif()
if("new-policy" IN_LIST FEATURES)
    set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)
endif()
if("packages" IN_LIST FEATURES)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py" "${CURRENT_PACKAGES_DIR}")
endif()
if("buildtrees" IN_LIST FEATURES)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py" "${CURRENT_BUILDTREES_DIR}")
endif()
if("native" IN_LIST FEATURES)
    cmake_path(NATIVE_PATH CURRENT_INSTALLED_DIR CURRENT_INSTALLED_DIR_NATIVE)
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/test.py" "${CURRENT_INSTALLED_DIR_NATIVE}")
endif()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/../../../LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
